#include "timer.h"
#include "eventloop.h"
#include "utils.h"

Timer::Timer()
{

}

void Timer::singleshot(int interval, const runnable& slot)
{
    auto e = EventLoop::current_eventloop();
    if (unlikely(!e)) {
        LOG_ERR("no eventloop found!");
        return;
    }
    e->singleshot(interval, slot, true);
}